<html lang="fr">
	<head>
		<meta charset="UTF-8" />
		<title>La Cueillette du Grand Parc</title>
		<link rel="icon" type="image/png" href="" />
		<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="" /><![endif]-->
		
		<!-- CSS-->
			<link href='http://fonts.googleapis.com/css?family=Cinzel+Decorative' rel='stylesheet' type='text/css'>
			<link href='http://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'>
			<link rel="stylesheet" type="text/css" href="css/style.css" />
			<link rel="stylesheet" type="text/css" href="css/component.css" />
			<link rel="stylesheet" type="text/css" href="css/responsive.css" />
			<link rel="stylesheet" type="text/css" href="css/slider.css" />
			<!-- thumbnail -->
			<link type="text/css" rel="stylesheet" href="css/thumbnail.css" />
		<!--end CSS-->
		
		<!-- JS-->
			<script src="js/modernizr.custom.js"></script>
			<script src="js/cbpHorizontalSlideOutMenu.min.js"></script>
			<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
			<script src="js/jsFormInscription.js"></script>
			
			 
			 
		<!--end JS-->
		
	</head>
	<body id="body">
		<div class="container">
			<p id="back-top" title="Revenir en haut de la page">
				<a href="#top"><img src="images/arrow-up-green.png"/></a>
			</p>
			<div id="main" class="main">
				<div id="topBar" class="topBar">
					<?php 
						require_once ('pages/header/topBar.php');
					?>
				</div>
				<div id="slider">
					<?php 
						require_once ('pages/header/slider.php');
					?>
				</div>
				<div id="menu">
				<?php 
					require_once ('pages/header/menu.php');
				?>
				</div>
			</div>
			<div id="contenu" class="contenuMid">			
				<?php 
					require_once ('pages/contenu/accueil.php');
				?>
			</div>
			
																<!-- -------------------- INFOS ----------------- -->
																
			<div class="containerInfos">
				<h1>Informations</h1>
				<div class="infos">
				
					<!-- widget meteo -->
					<div id="widget_02b83167a0ac3cfe4d17bcd321ed89c2" class="widgetMeteo">
						<span id="l_02b83167a0ac3cfe4d17bcd321ed89c2"><a href="http://www.my-meteo.fr/">My-Meteo</a></span>	
					</div>
					<!-- widget meteo -->
					
			<!-- Restos du Coeur -->
					<table class="tableRestosCoeur">
						<tr>
							<td>En partenariat avec</td>
							<td><a target="_blank" title="Vers le site des restos du coeur" href="http://www.restosducoeur.org/"><img height="130" src="images/informations/restos-du-coeur-logo.jpg"/></a></td>
						</tr>
					
					</table>
					<hr class="hrInfos"/>
					
			<!-- Nous Contacter -->
					<p><a class="contact" id="btnContact" title="Vers le formulaire de contact" >→ nous contacter</a></p>
					
			<!-- phones + adresse -->
					<div>
					<?php
						try{
							$sqlPhones='SELECT * FROM informations WHERE libelle=:fixe OR libelle=:mobile';
							$select = $connection->prepare($sqlPhones, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
							$select->execute(array(':mobile' => 'Mobile', ':fixe' => 'Fixe'));
							while($enregistrement = $select->fetch(PDO::FETCH_OBJ)){
								
								if ($enregistrement->libelle=="Mobile"){
									$image="contactMobile.png";
								}else{
									$image="contactFixe.png";
								}	
								$number=str_replace ( ".", "", $enregistrement->valeur);
								$number = "33".(substr($number, 1));
								$enregistrement->libelle= ucfirst($enregistrement->libelle);
						?>	
							<p><a title="<?php echo $enregistrement->libelle;?>" class="imgZoom" href="tel:<?php echo $number;?>"><img  src="images/informations/<?php echo $image;?>"/><span class="titleInfos"><?php echo $enregistrement->valeur;?></span></a></p>
						<?php 
							}
						}catch(Exception $e){
							echo "<h3 class='error'>Impossible de charger les numéros</h3>";
						}
					?>	
			<!-- adresse -->
						<table class="tableInfos">
							<?php
								try{
									$sqlAdr='SELECT * FROM informations WHERE libelle = :Lieu OR libelle = :cpVille OR libelle = :pays OR libelle = :raison' ;
									$select = $connection->prepare($sqlAdr, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
									$select->execute(array(':Lieu' => 'Lieu', ':cpVille' => 'Cp/Ville', ':pays' => 'Pays/Departement', ':raison' => 'Raison Sociale'));		
									while($enregistrement = $select->fetch(PDO::FETCH_OBJ)){
									?>						
										<tr>
											<td><?php echo $enregistrement->valeur;?></td>
										</tr>
									<?php 
									}
								}catch(Exception $e){
									echo "<h3 class='error'>Impossible de charger l'adresse</h3>";
								}
								?>
						</table>									
					</div>	
					<hr class="hrInfos"/>
					
			<!--  Horaires-->
					<div >		
						<h3>Horaires d'ouverture</h3>
						<table class="tableInfos">
							<?php
								try{
									$sqlHoraires='SELECT * FROM horaires';
									$select = $connection->prepare($sqlHoraires, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
									$select->execute();
									while ($enregistrement = $select->fetch(PDO::FETCH_OBJ) ){
									?>
									<tr>
										<td><?php echo $enregistrement->jour;?> : <?php echo $enregistrement->heures;?></td>
									</tr>
									<?php
									}
								}catch(Exception $e){
									echo "<h3 class='error'>Impossible de charger les horaires</h3>";	
								}	
							?>									
						</table>
					</div>
					<hr class="hrInfos"/>
				
			<!-- map Google -->
					<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d5210.087064596971!2d-0.5790700241434396!3d49.237663854404765!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x480a51a6ddf2d5c7%3A0x3b651664868f16d9!2sLe+Grand+Parc%2C+14480+Coulombs!5e0!3m2!1sfr!2sfr!4v1421776325895" width="300" height="200" frameborder="0" style="border:0"></iframe>
				</div>
			</div>											
																<!-- -------------------- NewsLetter ----------------- -->
																
			<div class="actusNewsletter">
				<?php
					try{
						$sqlNewsLetter='SELECT * FROM informations WHERE libelle=:newsletter';
						$select = $connection->prepare($sqlNewsLetter, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
						$select->execute(array(':newsletter' => 'Newsletter'));
						$enregistrement = $select->fetch(PDO::FETCH_OBJ);
				?>
						<h3 class="h3News"><img  src="images/informations/newsletter.png"/><span class="titleInfos">NewsLetter</span></h3>
						<p class="pNews"><?php echo $enregistrement->valeur;?></p>
				<?php 	
					}catch(Exception $e){
						echo "<h3 class='error'>Impossible de charger l'informtions newsletter</h3>";
					}
				?>
			</div>										
																
																<!-- -------------------- ACTUS ----------------- -->
			 
			<div id="actus" class="actus">
				<h1 class="actus">Actualités</h1>
				<p><a class="contact" onClick="return loadActus('all');" title="Voir toutes les actualités">→ toutes les actualités</a></p>
				<?php
				try{
					$sqlActus = 'SELECT * FROM actus ORDER BY dateCreation DESC, id DESC';
					$select = $connection->prepare($sqlActus, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
					$select->execute();
					while($enregistrement = $select->fetch(PDO::FETCH_OBJ)){
					?>
						<div onClick="return loadActus('<?php echo $enregistrement->id;?>');" title="Voir l'actualité <?php echo $enregistrement->titre;?>" class="eltActus">							
							<?php
								$image=null;
								$dateActuelle=date("Y-m-d");
								if ($dateActuelle==$enregistrement->dateCreation){
								$new="Nouveau";
								}else{
									$new="";
								}
								if($enregistrement->idImages!=null){
									try{
										$sqlImage = 'SELECT * FROM images WHERE id=:id';
										$select2 = $connection->prepare($sqlImage, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
										$select2->execute(array(':id' => $enregistrement->idImages));
										$enregistrement2 = $select2->fetch(PDO::FETCH_OBJ);
										if($enregistrement2){
											$image="<td class='widthImg'><img class='imgActus' src='images/$enregistrement2->chemin'/></td>";
										}
									}catch(Exception $e){
										echo "<h3 class='error'>Impossible de charger les images des actualités</h3>";
									}								
								}				
							?>
							<table id="tableActus">
								<tr>
									<td class="tdNew" colspan="1"><?php echo $new;?></td>
									<td rowspan="2"><h3  class="h3Actus"><?php echo $enregistrement->titre;?></h3><p class="pActus" ><?php echo $enregistrement->description;?></p></td>							
								</tr>
								<tr>
									<?php echo $image;?>
									
								</tr>
							</table>												
						</div>
					<?php
					}
				}catch(Exception $e){	
					echo "<h3 class='error'>Impossible de charger les actus</h3>";
				}
				?>
			</div>
			
													<!-- -------------------- FOOTER ----------------- -->
			
			<footer>
				<?php
					require_once ('pages/footer/footer.php');
				?>
			</footer>
		</div>
				
	<!-- JS PRINCIPAL -->
	<script src="js/jquery.slides.min.js"></script>	
	<script src="js/jsMain.js"></script>
	<!-- JS météo -->	
	<script type="text/javascript">
						(function() {
							var my = document.createElement("script"); my.type = "text/javascript"; my.async = true;
							my.src = "http://services.my-meteo.fr/widget/js-design.php?ville=36233&format=grand-rectangle&nb_jours=1&ombre1=000000&c1=ffffff&c2=9dc747&c3=ffffff&c4=ffffff&c5=ffffff&police=0&t_icones=1&fond=0&masque=0&x=300&y=128&id=02b83167a0ac3cfe4d17bcd321ed89c2";
							var z = document.getElementsByTagName("script")[0]; z.parentNode.insertBefore(my, z);
						})();
	</script>
	</body>
</html>
